﻿using System;

namespace StockAnalyst2.Options
{
	internal class ApplicationOptions : ICloneable, IEquatable<ApplicationOptions>
	{
		#region Properties

		public string UserName { get; set; }
		public string Password { get; set; }
		public string DatabaseServer { get; set; }
		public string DatabaseName { get; set; }
		public bool RealTimeEnabled { get; set; }

		#endregion

		#region Public Methods

		public ApplicationOptions(string userName, string password, string databaseServer, string databaseName, bool realTimeEnabled)
		{
			this.UserName = userName;
			this.Password = password;
			this.DatabaseServer = databaseServer;
			this.DatabaseName = databaseName;
			this.RealTimeEnabled = realTimeEnabled;
		}

		#endregion

		#region ICloneable

		public object Clone()
		{
			return new ApplicationOptions(this.UserName, this.Password, this.DatabaseServer, this.DatabaseName, this.RealTimeEnabled);
		}

		#endregion

		#region IEquatable<ApplicationOptions>

		public bool Equals(ApplicationOptions other)
		{
			return this.UserName == other.UserName && this.Password == other.Password && this.DatabaseServer == other.DatabaseServer && this.DatabaseName == other.DatabaseName && this.RealTimeEnabled == other.RealTimeEnabled;
		}

		#endregion
	}
}
